var { BrowserWindow } = require("electron")

const sendBackEvent = (type, data = {}) => {
BrowserWindow.getFocusedWindow()?.webContents.send('back-event', {type, data})
}

const refreshWinState = () => {
    let ret = {
        isMaximize: false,
    }
    let crntWin = BrowserWindow.getFocusedWindow()
    if (crntWin) {
        ret.isMaximize = crntWin.isMaximized();
    }
    sendBackEvent('refresh-win-state', ret)
}
module.exports = {
    refreshWinState
}